<!-- 引入编辑器文件 @mk-qiniu -->
{if(QINIU_OPEN == 'true')}
<script type="text/javascript" charset="utf-8" src="{CORE_DIR}/extend/qiniu_ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="{CORE_DIR}/extend/qiniu_ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="{CORE_DIR}/extend/qiniu_ueditor/lang/zh-cn/zh-cn.js"></script>
{else}
<script type="text/javascript" charset="utf-8" src="{CORE_DIR}/extend/ueditor/ueditor.config.js?v=v2.0.1"></script>
<script type="text/javascript" charset="utf-8" src="{CORE_DIR}/extend/ueditor/ueditor.all.min.js?v=v2.0.1"> </script>
<script type="text/javascript" charset="utf-8" src="{CORE_DIR}/extend/ueditor/lang/zh-cn/zh-cn.js?v=1.3.5"></script>
{/if}

<script>
    //初始化编辑器
    $(document).ready(function (e) {
        var ue = UE.getEditor('editor',{
            maximumWords:30000
        });
    })
</script>


<script type="text/javascript">
    <!-- 解决源码模式无法保存 -->
    function editor_init() {
        $('#edit').submit(function () {
            editor=UE.getEditor('editor');
            if(editor.queryCommandState('source')==1) editor.execCommand('source');
        })
    }

    <!-- 点击后添加到编辑器 -->
    $(".addedit").on("click",'img',function(){
        editor=UE.getEditor('editor');
        $img = $(this).attr("src");
        editor.execCommand('inserthtml',"<img src='"+$img+"'>");
    });

</script>

<script type="text/javascript">editor_init();</script>



